<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>参与砸金蛋</title>
    <script src="jquery.min.js"></script>
    <style>
        .box{
            position: absolute;
            width: 350px;
            height: 150px;
            background: url(images/egg.png);
			display: none;
        }
		.cur{
			transform: translate(-50%,-50%);
			opacity: .9
		}
    </style>
	<script type="text/javascript" src="js/jquery2.1.4.min.js"></script>
</head>

<body>
    <button>砸金蛋</button>
    <div class="box"></div>
	<script type="text/javascript">
		$(function(){
			$('button').click(function(){
				//console.log('123');
				$('.box').show().animate({
					//属性名:属性值
					left:'50%',
					top:'50%'
				},'slow',function(){
					console.log('动画完成了么?');
					$('.box').addClass('cur');
				});
			});
			
/* 			$('button').click(function(){
				//console.log('123');
				$('.box').animate({
					//属性名:属性值
					left:'50%',
					top:'50%'
				},'slow',function(){
					console.log('动画完成了么?');
					$('.box').addClass('cur').fadeIn();
				});
			}); */
		});
	</script>
</body>

</html>